package com.java.control.impl;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;

import com.java.control.AbstractAdminCommandController;
import com.java.control.search.OrderSearchCond;
import com.java.control.search.SearchStat;
import com.java.control.search.SupplierQuotationSearchCond;
import com.java.entity.OrderForm;
import com.java.entity.Product;
import com.java.entity.SupplierQuotation;
import com.java.service.OrderService;
import com.java.service.ProductService;
import com.java.service.SupplierQuotationService;

/**
 * 产品右边供应商报价信息控制器
 * @author wqf
 * @version  Nov 14, 2011 2:38:40 PM
 */
public class OrderRightController extends AbstractAdminCommandController {
	
	public OrderRightController(){
		this.setCommandClass(OrderSearchCond.class);
	}	
	
	private String successView;
	public void setSuccessView(String successView) {
		this.successView = successView;
	}
	
	protected ModelAndView executeRequest(HttpServletRequest request,HttpServletResponse response,Object command)
	throws Exception{
		ModelAndView mav=new ModelAndView(this.successView);
		String id=request.getParameter("id");
		OrderForm order = null;
		if(null!=id){
			order = this.orderService.getOrderById(Long.parseLong(id),false);			
		}
		mav.addObject("orderForm", order);
		
		return mav;
	
	}
	
	private OrderService orderService;
	
	public String getSuccessView() {
		return successView;
	}

	public void setOrderService(OrderService orderService) {
		this.orderService = orderService;
	}

}
